#include<bits/stdc++.h>

using namespace std;
using ll=long long;
const int n = 100;

ll h(ll x) {
    return x * x * x * x * x;
}

ll H[101];

/**
 * @return
 */
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    // 记录开始时间
    auto start = chrono::steady_clock::now();

    for (int i = 1; i <= n; i++) {
        H[i] = h(i);
    }
    ll a, b, c, d, e, f;
    for (a = 1; a <= n; a++)
        for (b = a; b <= n; b++)
            for (c = b; c <= n; c++)
                for (d = c; d <= n; d++)
                    for (e = d; e <= n; e++) {
                        {
                            ll x = H[e] + H[d] + H[c] + H[b] + H[a];
                            ll f = lower_bound(H + e + 1, H + n + 1, x) - H;
                            if (H[f] == x) {
                                cout << a << " " << b << " " << c << " " << d << " " << e << " " << f << endl;
                            }

                        }
                    }
    auto end = chrono::steady_clock::now();
    cerr << chrono::duration<double, milli>(end - start).count() << " ms" << endl;// 5417.95 ms

    return 0;
}